# Storage

RMK's storage system provides persistent data storage for keyboard settings, keymaps, and system configuration. It uses your microcontroller's internal flash memory to save changes between power cycles.

::: tip
For most users, the [default storage configuration](https://github.com/HaoboGu/rmk/tree/main/rmk-config/src/default_config) works perfectly. If there's no default config for your chip, the **last two sectors** will be used. In most cases, you only need to modify settings for advanced use cases or when troubleshooting storage-related issues.
:::

The `[storage]` section in `keyboard.toml` configures RMK's storage.

## Configuration Options



import { Rust, Toml } from '../../components/LangBadge'
import { Tab, Tabs } from '@theme'

<Tabs>
<Tab label={<Toml />}>

```toml title="keyboard.toml"
[storage]
# Enable/disable storage feature (default: true)
enabled = true
# Number of flash sectors to allocate (default: 2)
num_sectors = 2
# Storage start address (default: 0 = auto-allocate from end)
start_addr = 0x00000000
# Clear all storage data on boot, including keymap, BLE bonds, etc
clear_storage = false
# Clear only layout/keymap data, preserve BLE bonds
clear_layout = false
```


</Tab>
<Tab label={<Rust />}>

```rust title="main.rs"

let storage_config = StorageConfig {
    start_addr: 0x70000,    // Custom start address
    num_sectors: 2,         // Number of sectors
    ..Default::default()
};

let rmk_config = RmkConfig {
    storage_config,
    ..Default::default()
};

```

</Tab>
</Tabs>
